package br.com.officium.managedbean.cadastro;

import br.com.officium.entidade.cadastro.Contratado;
import br.com.officium.sessionbean.ContratadoBsn;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author Ivo
 */
@ManagedBean
@ViewScoped
public class ContratadoBean extends CadastroAbstractBean {
    
    @EJB
    private ContratadoBsn contratadoBsn;
    private Contratado contratado;
    private List<Contratado> contratados;

    public ContratadoBean() {
    }

    @Override
    public String listar() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void cadastrar() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void editar() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void excluir() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean isPaginator() {
        return contratadoBsn.count() > ROW_NUMBER;
    }
    
    private void clear() {
        this.contratado = new Contratado();
        super.cleanSubmittedValues(panelForm);
    }

    public Contratado getContratado() {
        return contratado;
    }

    public List<Contratado> getContratados() {
        return contratados;
    }

}
